Mining of Source Code Concepts and Idioms An Approach based on Clone Detection Techniques

نویسنده

  • Torsten Görg
چکیده

This paper introduces a new view on program source code with a focus on code clone information. An algorithm is presented that transforms source code into an equivalent representation which expresses code redundancies as hierarchical clone classes explicitly. This representation supports program comprehension by pointing out arbitrary programming idioms and the frequencies of their occurrences in the program code. In contrast to most other code clone detection techniques looking for the largest clone fragments only the algorithm shown here provides clone classes for all fragment granularities and include relationships between the clone classes. This makes visible the full range from small idioms that occur frequently in the code to large fragments that are rarely used. Furthermore the provided code representation is specially designed to express parameterized clones as most programming idioms are not an adhesive code block but rather a subtree taken form the middle of an AST, e.g., the concept of a foreach loop without the loop body. The clone information condensed in the representation form shown here can either be used to support idiom-based program understanding. Or it can be used to refactor the most frequent idioms as new language concepts in a DSL in order to compact a given amount of source code.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Towards Maintenance Support for Idiom-based Code Using Sequential Pattern Mining

Developers often use an idiom to implement a concern. When a fault is found in an idiom, developers have to find all source code fragments derived from the original. While code-clone detection tools can detect copy-andpasted code, such tools cannot detect code fragments modified after pasted. We are investigating a sequential pattern mining approach to capture idiom-based code that spread acros...

متن کامل

A Technique for Identifying and Testing Structural Clones in Large Scale Systems

Clones have played an important role in increasing the software’s maintenance and decreasing the quality. Hence detecting the clones and removing them has been an interesting scenario. Detecting clones not only improves the productivity of software but also enhances re-usability. A number of techniques were presented in the past but they have had there own drawbacks. Efficient algorithms are cr...

متن کامل

Hybrid Approach for Efficient Software Clone Detection

Software cloning is a methodology which defines that if any size of code is used apart from its original place to some another place as it is or with some modification to perform same functionality. This activity is also known as reuse of repeating code at many places instead of writing a new code. The original piece of code which is reused is called code cloning and copied form of that code is...

متن کامل

The effect of source shield on landmine detection

Background: Several landmine detection methods, based on nuclear techniques, have been suggested during the recent years. Neutron energy moderation, neutron-induced gamma emission, neutron and gamma attenuation, and fast neutron backscattering are nuclear-based methods used for landmine detection. The aim of this study is to use backscattered neutron for landmine detection. Materials ...

متن کامل

Generating Gapped Code Clone Information using Graph Mining Algorithm

At present, various kinds of code clone detection techniques have veen proposed. However, most of them cannot detect gapped code clones, which are ones that includes non-duplicated segments to its correspondant code clones. In this paper, we propose a method generating gapped code clone information from a detection result of existing code clone detection tools. The method adopts AGM (Apriori-ba...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013